import React from 'react'
import ReactDOM from 'react-dom/client'
import App from '@/App'
import AppComment from '@/AppComment'
import { Provider } from 'react-redux'
import store from '@/store/index'
import router from '@/router/index'
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
import './theme.css'
import * as CesiumJS from 'cesium'

// 配置 Cesium 资源路径
window.CESIUM_BASE_URL = './cesium/Build/Cesium/'

CesiumJS.Ion.defaultAccessToken =
  'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyMDYxMTZlZS00YzAyLTQxNzgtYjQ4ZS04MDdlYzQ4MjlkM2MiLCJpZCI6MzYwNjY1LCJpYXQiOjE3NjMyMTY3OTR9.z3JNPk_CH8xX-lO25RQjfItrByWG-oVvDPFFv5T1WfQ'

const root = ReactDOM.createRoot(document.getElementById('root'))
//在react中使用store的数据，需要用到一个钩子函数-useSelector,它的作用是把store中的数据映射到组件中
root.render(
  <Provider store={store}>
    <div>
      <RouterProvider router={router}></RouterProvider>
      {/* <AppComment /> */}
    </div>
  </Provider>
)
